package com.hellacutty.shake;

import android.widget.Toast;

public class BluetoothHelper {
    /**
     * Sends a message.
     * @param message  A string of text to send.
     */
    public static boolean sendMessage(String message, BluetoothChatService mChatService) {
        // Check that we're actually connected before trying anything
        if (mChatService.getState() != BluetoothChatService.STATE_CONNECTED) {
            return false;
        }

        // Check that there's actually something to send
        if (message.length() > 0) {
            // Get the message bytes and tell the BluetoothChatService to write
            byte[] send = message.getBytes();
            mChatService.write(send);
            return true;
        }

        return false;
    }

}
